package com.bullbuddy.po;

import java.sql.Connection;
import java.sql.SQLException;

import com.bullbuddy.util.DataSourceUtil;

public abstract class ConnectSwitch {
	protected Connection conn;

	protected void openConnection() throws SQLException {
		if (conn != null && !conn.isClosed())
			return;
		conn = DataSourceUtil.getConnection();
	}

	protected void closeConnection() throws SQLException {
		if (conn != null && !conn.isClosed())
			conn.close();
	}
}
